package com.woniuxy.controller;

import com.github.pagehelper.PageInfo;
import com.woniuxy.annotation.RequirePermission;
import com.woniuxy.entity.Log;
import com.woniuxy.service.log.LogService;
import com.woniuxy.util.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
public class LogController {
    @Autowired
    private LogService logService;

    @RequirePermission("log:find")
    @PostMapping("log/selLog")
    public ResultVo selLog(@RequestBody Map<String,String> map){
        String page = map.remove("page");
        String size = map.remove("size");
        PageInfo<Log> info = logService.selLog(Integer.valueOf(page), Integer.valueOf(size));
        return ResultVo.success(info);
    }
}
